package com.csap.framework.oauth2.server.mybatis.entity;

import com.csap.mybatisplus.annotation.TableField;
import com.csap.mybatisplus.extension.handlers.FastjsonTypeHandler;
import lombok.Data;
import lombok.AllArgsConstructor;
import com.csap.mybatisplus.annotation.IdType;
import com.csap.mybatisplus.annotation.TableId;
import lombok.NoArgsConstructor;
import lombok.Builder;
import com.csap.mybatisplus.annotation.TableName;
import lombok.experimental.Accessors;

import java.util.Set;

/**
 * <p>
 * 用户独立拥有的权限
 * </p>
 *
 * @author yangchengfu
 * @dateTime 2023-11-22 22:56:44
 */
@Data
@TableName(value = "user_permissions", autoResultMap = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class UserPermissionsEntity {
    /**
     * 用户Id
     */
    @TableId(type = IdType.NONE, value = "user_id")
    private String userId;
    /**
     * 拥有的权限[1,2]
     */
    @TableField(typeHandler = FastjsonTypeHandler.class)
    private Set<String> permissions;

}
